﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeGame.Networking.Serverside.ClientServerPackets
{
    class SendMessagePacket : ServerPacket
    {
        public override ClientServerNet GetID()
        {
            return ClientServerNet.SendMessageRequest;
        }

        public override void Handle(Lidgren.Network.NetIncomingMessage message, Lidgren.Network.NetConnection sender)
        {
            string subject = message.ReadString();
            string content = message.ReadString();

            ServerObjects.ServerSingletons.Message.PostMessage(subject, content);
        }

    }
}
